from dash import html,register_page
from gypb.component import CRUDTable

register_page(__name__, name="属性管理", order=9)

table = CRUDTable(
    name="属性表",
    db_path="dfs://infos",
    table_name="attribute",
    key_cols=["type","frequency","attribute"],
    # db_cols=["type","frequency","attribute","name","attribute_type","index_type","target_type","db_name","table_name"],
    # col_names=["类型","频率","属性名","属性含义","数据类型","索引类型","目标列类型","所在数据库","所在表"],
    editable_cols=["属性注释","数据类型","索引列类型","对象列类型","数据库名","表名"],
    enable_delete=True,
    enable_modify=True,
    # table_name="manager_pool",
    # key_cols=["code"],
)
# table = get_crud_table(
#     index="ceshi",
#     session=session,
#     db_path="dfs://infos",
#     table_name="manager_pool",
#     db_cols=[
#         "pool_name",
#         "strategy",
#         "prod_code",
#     ],
#     col_names=[
#         "池子名",
#         "策略",
#         "产品代码",
#     ],
#     enable_delete=True,
#     enable_add=True,
# )

layout = html.Div([table.layout])
